package com.singzi.leetcode.N100;

public class T0070stairs {

    public static void main(String[] args) {
        Solution0070 solution0070 = new Solution0070();
        for (int i = 0; i < 46; i++) {
            System.out.println("dp["+i+"] = "+solution0070.climbStairs(i)+";");
        }

    }
}
class Solution0070 {
    public int climbStairs(int n) {
        if(n<=2) return n;

        int[]dp = new int[n];

        dp[0] = 1;
        dp[1] = 2;
        for(int i = 2;i < n;i++){
            dp[i] = dp[i-1]+dp[i-2];
        }
        return dp[n-1];

    }
}